package daybook.io.args;

import com.beust.jcommander.Parameters;
import com.beust.jcommander.ParametersDelegate;
import daybook.io.formatter.Format;

import java.util.Objects;

import static daybook.Resources.RESOURCES_NAME;
import static daybook.Resources.Usages.COMMAND_BOOK;

@Parameters(separators = "=", resourceBundle = RESOURCES_NAME,
        commandDescriptionKey = COMMAND_BOOK)
public class CommandBook {
    @ParametersDelegate
    private final FormatArgs formatArgs;

    public CommandBook(FormatArgs formatArgs) {
        this.formatArgs = Objects.requireNonNull(formatArgs);
    }

    public Format getFormat() {
        return formatArgs.getFormatWithDefault();
    }
}